package backend.service.base;

import backend.model.base.DBModel;
import org.hibernate.criterion.DetachedCriteria;

import java.util.Collection;
import java.util.List;

public interface DBModelDao<DBM extends DBModel> {

    public DBM getById(Class<DBM> entityClass, int id);

    public void saveOrUpdate(DBM dbModel);

    public void bulkSaveOrUpdate(Collection<DBM> dbModelCollection);

    public void save(DBM dbModel);

    public void bulkSave(Collection<DBM> dbModelCollection);

    public void update(DBM dbModel);

	public void delete(DBM dbModel);

    public void bulkDelete(Collection<DBM> dbModelCollection);

    public List<DBM> findByNamedQuery(String queryName);

    List<DBM> findByNamedQueryAndParams(String queryName, String[] paramNames, Object[] paramValues);

    DBM findSingleResultByCriteria(DetachedCriteria criteria);
}